<?php $config=config('UPLOAD') ?>
<style>
body,html { overflow:hidden}
</style>
</head>
<body>
<script language="javascript">
function challs_flash_update(){
	var a={};
	a.title = "上传文件";
	a.url = '<?php echo url("upload/upload_data",array("session"=>session_id())) ?>'; 
	a.parameter = "";
	a.typefile = ["File (*.jpg;*.gif;*.png,*.jpeg)","*.jpg;*.gif;*.png,*.jpeg"];
	a.size = {$size};
	a.autoClose = 1;
	a.repeatFile = true;
	a.returnServer = true;
	a.loadFileOrder=true;
	a.ListShowType = 2;
	a.TitleSwitch = false;
	a.autoUpload = false;
	a.adjustOrder = true;
	a.deleteAllShow = true;
	a.isShowUploadButton = true;
	a.FormID = ['WATERMARK_ON','WATERMARK_POSITION','THUMBNAIL_ON','THUMBNAIL_WIDTH','THUMBNAIL_HEIGHT','THUMBNAIL_TYPE'];
	return a;
}

function challs_flash_style(){ //组件颜色样式设置函数
	var a = {};
	
	/*  整体背景颜色样式 */
	a.backgroundColor=['#fff'];	//颜色设置，3个颜色之间过度
	a.backgroundLineColor='#fff';					//组件外边框线颜色
	a.backgroundFontColor='#066AD1';					//组件最下面的文字颜色
	a.backgroundInsideColor='#FFFFFF';					//组件内框背景颜色
	a.backgroundInsideLineColor=['#ccc','#ccc'];	//组件内框线颜色，2个颜色之间过度
	
	/*  按钮颜色样式 */
	a.button_overColor=['#FBDAB5','#f3840d'];			//鼠标移上去时的背景颜色，2个颜色之间过度
	a.button_overLineColor='#e77702';					//鼠标移上去时的边框颜色
	a.button_overFontColor='#ffffff';					//鼠标移上去时的文字颜色
	a.button_outColor=['#fdfdfd','#e8e8e8']; 			//鼠标离开时的背景颜色，2个颜色之间过度
	a.button_outLineColor='#d0d0d0';					//鼠标离开时的边框颜色
	a.button_outFontColor='#333333';					//鼠标离开时的文字颜色
	
	/* 滚动条样式 */	
	a.List_scrollBarColor=0x000000;				//滚动条颜色
	a.List_scrollBarGlowColor=0xcccccc;			//滚动条阴影颜色

	/* 文件列表样式 */
	a.List_backgroundColor='#f5f5f5';					//列表背景色
	a.List_fontColor='#333333';						//列表文字颜色
	a.List_errFontColor='#ff0000';							//列表错误信息文字颜色
	a.List_LineColor='#cccccc';							//列表分割线颜色
	a.List_cancelOverFontColor='#ff0000';				//列表取消文字移上去时颜色
	a.List_cancelOutFontColor='#D76500';				//列表取消文字离开时颜色
	a.List_progressBarLineColor='#B3CDF1';				//进度条边框线颜色
	a.List_progressBarBackgroundColor='#D8E6F7';		//进度条背景颜色
	
	/* 错误提示框样式 */
	a.Err_backgroundColor='#C0D3EB';					//提示框背景色
	a.Err_fontColor='#245891';							//提示框文字颜色
	a.Err_shadowColor='#000000';						//提示框阴影颜色
	return a;
}

var win;
var challs_flash_onCompleteAll = new function(){}; 
var challs_flash_deleteAllFiles = new function(){}; 
var challs_flash_onCompleteData = new function(){}; 
var challs_flash_FormData = new function(){}; 
Do.ready("dialog", function() {
	var win = art.dialog.open.origin;
	
	window.challs_flash_onCompleteData=function challs_flash_onCompleteData(data){
		var data=eval("("+data+")");
		if(data.status=='y')
		{
			var html='<li>\
					<div class="pic">\
							<img src="'+data.info.url+'" />\
						</div>\
					<input  id="{$id}[]" name="{$id}[]" type="hidden" value="'+data.info.url+'" />\
                    <input  id="{$id}_original[]" name="{$id}_original[]" type="hidden" value="'+data.info.original+'" />\
					<div>描述：<input name="{$id}_title[]" id="{$id}_title[]" type="text" class="u-ipt" style="width:80px !important" id="" value="" /></div>\
					<div>顺序：<input name="{$id}_order[]" id="{$id}_order[]" type="text" class="u-ipt" style="width:40px !important" id="" value="0" />&nbsp;&nbsp;<a href="javascript:void(0);" onclick="$(this).parent().parent().remove()">删除</a></div>\
			</li>';
			$('#{$id}_list ul',win.document).append(html);
			$('#file_id',win.document).val($('#file_id',win.document).val()+data.info.id+',');
		}else{
			art.dialog.tips(data.info, 3);
		}
	}
	
	window.challs_flash_onCompleteAll=function challs_flash_onCompleteAll(a){
		art.dialog.close();
	}
	
	window.challs_flash_deleteAllFiles=function challs_flash_deleteAllFiles(){
		return confirm("你确定要清空列表吗?");
	}
	
	window.challs_flash_FormData=function challs_flash_FormData(a){ // 使用FormID参数时必要函数
		try{
			var value = '';
			var id=document.getElementById(a);
			if(id.type == 'radio'){
				var name = document.getElementsByName(id.name);
				for(var i = 0;i<name.length;i++){
					if(name[i].checked){
						value = name[i].value;
					}
				}
			}else if(id.type == 'checkbox'){
				var name = document.getElementsByName(id.name);
				for(var i = 0;i<name.length;i++){
					if(name[i].checked){
						if(i>0) value+=",";
						value += name[i].value;
					}
				}
			}else if(id.type == 'select-multiple'){
				for(var i=0;i<id.length;i++){
					if(id.options[i].selected){
						if(i>0) value+=",";
						 values += id.options[i].value; 
					}
				}
			}else{
				value = id.value;
			}
			return value;
		 }catch(e){
			return '';
		 }
	}

	
})
</script>
<div style="margin-top:10px; padding-left:20px;"> 添加水印
    <input id="WATERMARK_ON" type="checkbox" name="WATERMARK_ON" <?php if($config['WATERMARK_ON']){ ?> checked="checked" <?php } ?> value="1">
    &nbsp;&nbsp;水印位置
    <select id="WATERMARK_POSITION" name="WATERMARK_POSITION">
      <option <?php if($config['WATERMARK_POSITION']==0){ ?> selected="selected" <?php } ?> value="0">随机</option>
      <option <?php if($config['WATERMARK_POSITION']==1){ ?> selected="selected" <?php } ?> value="1">左上</option>
      <option <?php if($config['WATERMARK_POSITION']==2){ ?> selected="selected" <?php } ?> value="2">中上</option>
      <option <?php if($config['WATERMARK_POSITION']==3){ ?> selected="selected" <?php } ?> value="3">右上</option>
      <option <?php if($config['WATERMARK_POSITION']==4){ ?> selected="selected" <?php } ?> value="4">左中</option>
      <option <?php if($config['WATERMARK_POSITION']==5){ ?> selected="selected" <?php } ?> value="5">正中</option>
      <option <?php if($config['WATERMARK_POSITION']==6){ ?> selected="selected" <?php } ?> value="6">右中</option>
      <option <?php if($config['WATERMARK_POSITION']==7){ ?> selected="selected" <?php } ?> value="7">左下</option>
      <option <?php if($config['WATERMARK_POSITION']==8){ ?> selected="selected" <?php } ?> value="8">中下</option>
      <option <?php if($config['WATERMARK_POSITION']==9){ ?> selected="selected" <?php } ?> value="9">右下</option>
    </select>
    &nbsp;&nbsp;是否缩图
    <input id="THUMBNAIL_ON" type="checkbox" name="THUMBNAIL_ON"  <?php if($config['THUMBNAIL_ON']){ ?> checked="checked" <?php } ?> value="1">
    &nbsp;&nbsp;宽度
    <input id="THUMBNAIL_WIDTH"  class="u-ipt u-ipt-2" type="text" maxlength="3" value="{$config['THUMBNAIL_WIDTH']}" name="THUMBNAIL_WIDTH">
    &nbsp;&nbsp;高度
    <input id="THUMBNAIL_HEIGHT"  class="u-ipt u-ipt-2" type="text" maxlength="3" value="{$config['THUMBNAIL_HEIGHT']}" name="THUMBNAIL_HEIGHT">
    &nbsp;&nbsp;
    <select id="THUMBNAIL_TYPE" name="THUMBNAIL_TYPE">
      <option <?php if($config['THUMBNAIL_TYPE']==1){ ?> selected="selected" <?php } ?> value="1">裁剪</option>
      <option <?php if($config['THUMBNAIL_TYPE']==0){ ?> selected="selected" <?php } ?> value="0">按比例</option>
    </select>
  </div>

  <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0" width="615" height="360" id="update" align="middle">
<param name="allowFullScreen" value="false" />
    <param name="allowScriptAccess" value="always" />
	<param name="movie" value="__PUBLIC__/ui/upload/update.swf" />
    <param name="quality" value="high" />
    <param name="bgcolor" value="#ffffff" />
    <embed src="__PUBLIC__/ui/upload/update.swf" quality="high" bgcolor="#ffffff" width="615" height="360" name="update" align="middle" allowScriptAccess="always" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
	</object>

</body>